
public class FizzBuzzer {

	public String until(int n) {
		StringBuilder builder = new StringBuilder();
		builder.append(0);
		
		for (int i = 1; i <= n; i++) {
			builder.append(' ');
			builder.append(only(i));
		}
		return builder.toString();
	}

	public String only(int n) {
		StringBuilder builder = new StringBuilder();
		Logic l = Logic.getInstance();
		for(Rule r : l.rules) {
			builder.append(r.play(n));
		}
		if(builder.toString().equals(""))return new Integer(n).toString();
		else return builder.toString();
		
	}

}
